//
//  PAWebSocketManager.h
//  PilotSeries
//
//  Created by 黄立强 on 16/6/29.
//  Copyright © 2016年 leon.huang. All rights reserved.
//

#import <Foundation/Foundation.h>
@class PAWebSocketManager;
@protocol  PAWebSocketManagerFirstOpenDelegete <NSObject>

-(void)webSocketManagerFirstOpen:(PAWebSocketManager *)manager;

@end
@class SRWebSocket;
@interface PAWebSocketManager : NSObject

@property (strong, nonatomic) SRWebSocket *webSocket;

@property (nonatomic, retain) NSTimer  *connectTimer;

@property (copy, nonatomic) NSString *url;

@property (nonatomic, assign,getter=isFirstOpen) BOOL firstOpen;

@property (weak, nonatomic) id<PAWebSocketManagerFirstOpenDelegete> firstOpenDelegate;

+ (instancetype)sharedInstance;

-(void) connectToWebSocketServer:(NSString *) url;

-(BOOL)sendMsg:(id)data;

- (void)reconnect;


@end
